<?php defined('IN_YuLin') || exit('NO PERMIT!'); ?>
{template index/header}

<div class="x-nav">
	<span class="layui-breadcrumb">
		<a>首页</a>
		<a>会员管理</a>
		<a>资金记录</a>
	</span>
	<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
		<i class="layui-icon" style="line-height:30px">ဂ</i>
	</a>
	<!--<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin:3px 5px 0 0;float:right" href="?m={$m}&c={$c}&a=add" title="添加">
		<i class="layui-icon" style="line-height:30px">添加</i>
	</a>-->
</div>

<div class="x-body">
	<div id="searchid" class="layui-clear margin-b10">
		<form name="searchform" class="layui-form" action="?" method="get" >
			<input type="hidden" name="m" value="{$m}" />
			<input type="hidden" name="c" value="{$c}" />
			<input type="hidden" name="a" value="{$a}" />
			<div class="left" style="width:100px;">
				<select name="tid">
					<option value="0">选择类型</option>
					{loop $tids as $key => $val}
                    <option value="{$key}"{if $tid == $key} selected="selected"{/if} >{$val['name']}</option>
                    {/loop}
				</select>
			</div>
			<div class="left margin-l10">
				<input name="dt1" id="dt1" type="text" value="{$dt1}" class="layui-input date" style="width:100px;" placeholder="开始时间" />
			</div>
			<div class="left margin-l10" style="padding-top:10px;">~</div>
			<div class="left margin-l10">
				<input name="dt2" id="dt2" type="text" value="{$dt2}" class="layui-input date" style="width:100px;" placeholder="结束时间" />
			</div>
			<div class="left margin-l10">
				<input name="title" id="title" type="text" value="{$title}" class="layui-input" style="width:260px;" placeholder="请输入关键词" />
			</div>
			<div class="left margin-l10">
				<input type="submit" name="search" class="layui-btn" value="搜索" />
			</div>
		</form>
	</div>
	
	<table class="layui-table">
		<thead>
			<tr>
				<th>ID</th>
				<th>账号</th>
				<th>类型</th>
				<th>金额</th>
				<th>账户余额</th>
				<th>备注</th>
				<th>时间</th>
			</tr>
		</thead>
		<tbody id="datalist">
			{loop $data as $val}
			<tr>
				<td>{$val['id']}</td>
				<td><a href="?m={$m}&c={$c}&a={$a}&uid={$val['uid']}">{$val['username']}</a></td>
				<td><a href="?m={$m}&c={$c}&a={$a}&tid={$val['tid']}">{$tids[$val['tid']]['name']}</a></td>
				<td>
					{if $val['balance'] > $val['balance_old']}
						<span class="red">+ {$val['money']}</span>
					{else}
						<span class="green">- {$val['money']}</span>
					{/if}
				</td>
				<td>{$val['balance']}</td>
				<td>{$val['notes']}</td>
				<td>{date('Y-m-d H:i:s',$val['dateline'])}</td>
			</tr>
			{/loop}
		</tbody>
	</table>
	<div class="layui-clear">
		<div id="pages" class="layui-laypage right">{$multi}</div>		
	</div>
</div>

{template index/footer}